<template>
  <el-select :value="value" :filterable="filterable" placeholder="请选择" @change="handleChange" :disabled="disabled">
    <el-option v-for="item,index in options" :key="index" :label="item.dicName" :value="item.id">
    </el-option>
  </el-select>
</template>

<script>
export default {
  props: {
    options: {
      type: Array,
      default: () => []
    },
    filterable: {
      type: Boolean,
      default: false
    },
    disabled: {
      type: Boolean,
      default: false
    },
    value: {
      type: [String, Number],
      default: ""
    }
  },
  data() {
    return {};
  },

  methods: {
    handleChange(val) {
      let obj = {};
      this.options.find((i) => {
        if (i.id === val) {
          obj = i;
        }
      });
      this.$emit("input", obj);
    }
  }
};
</script>
<style lang="less" scoped>
:deep(.el-select) {
  height: 40px;
}
</style>
